<?php

/**
 * Vote form base class.
 *
 * @method Vote getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVoteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'vote_id'       => new sfWidgetFormInputHidden(),
      'celebrity_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'add_empty' => true)),
      'count_i'       => new sfWidgetFormInputText(),
      'status_i'      => new sfWidgetFormInputText(),
      'order_i'       => new sfWidgetFormInputText(),
      'daily_count'   => new sfWidgetFormInputText(),
      'weekly_count'  => new sfWidgetFormInputText(),
      'monthly_count' => new sfWidgetFormInputText(),
      'name'          => new sfWidgetFormInputText(),
      'txt'           => new sfWidgetFormInputText(),
      'renqi_vote_id' => new sfWidgetFormInputText(),
      'count_mask_i'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'vote_id'       => new sfValidatorChoice(array('choices' => array($this->getObject()->get('vote_id')), 'empty_value' => $this->getObject()->get('vote_id'), 'required' => false)),
      'celebrity_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'required' => false)),
      'count_i'       => new sfValidatorInteger(array('required' => false)),
      'status_i'      => new sfValidatorInteger(array('required' => false)),
      'order_i'       => new sfValidatorInteger(array('required' => false)),
      'daily_count'   => new sfValidatorInteger(array('required' => false)),
      'weekly_count'  => new sfValidatorInteger(array('required' => false)),
      'monthly_count' => new sfValidatorInteger(array('required' => false)),
      'name'          => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'txt'           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'renqi_vote_id' => new sfValidatorInteger(array('required' => false)),
      'count_mask_i'  => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('vote[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Vote';
  }

}
